package model

import modelApp.EdicionCaracteristicaAppModel
import org.uqbar.arena.layout.VerticalLayout
import org.uqbar.arena.widgets.Panel
import org.uqbar.arena.windows.WindowOwner
import templates.EdicionAtributos
import templates.MyOwnSimpleWindow

class EditarCaracteristicasView extends MyOwnSimpleWindow<EdicionCaracteristicaAppModel>{
	
	@Property EdicionAtributos template = new EdicionAtributos

	new(WindowOwner parent, Pais pais) {
		super(parent, new EdicionCaracteristicaAppModel(pais) )
	}
	
	override createContents(Panel mainPanel) {
		this.setTitle("Editar Caracteristicas")
		mainPanel.setLayout(new VerticalLayout)
		
		this.template.listaEliminable(mainPanel, "Caracteristicas","paisUM.caracteristicas",
			"caracteristicaDel",[|modelObject.quitarCaracteristica])
				
		this.template.agregarAtributoTBox(mainPanel,"nuevaCaracteristica",
			[| modelObject.agregarCaracteristica  modelObject.nuevaCaracteristica= " " ], [|close])
		
	}
	
}